import 'package:getxdemo/http/http_request.dart';
import 'package:getxdemo/http/request_api.dart';
import 'package:getxdemo/utils/sp_util.dart';

import '../model/request_register.dart';
import 'package:getxdemo/http/request.dart';

class RequestRepository{
  RequestRepository();


  login(String userCount,String passWord,Success<UserEntity> success,Fail? fail ){
    Request.post(RequestApi.apiLogin, {
      'username':userCount,
      'password':passWord
    },success: (data){
     UserEntity entity =  UserEntity.fromJson(data);
     entity.password = passWord;
     SPUtil.saveUserInfo(entity);
     success(entity);
    },fail: fail);
  }

}